
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link href="css/ydh.css" rel="stylesheet" id="lhgdialoglink">

	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="renderer" content="webkit">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>三鑫灯世界 - 商品详情</title>
	<link rel="stylesheet" href="__PUBLIC__/css/c.css">
	<link rel="stylesheet" href="__PUBLIC__/css/page.css">
	<link rel="stylesheet" href="__PUBLIC__/css/header.css">
	<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
	<style type="text/css">
		/* color */
		*{margin: 0;padding: 0}
		body{font-size: 12px;font-family:"微软雅黑";}
		ul,li{list-style: none;}
		a:link,a:visited{text-decoration: none;}
		.list{width: 100%;border-bottom:solid 1px #316a91;margin:0 auto 0 auto;}
		.list ul li{background-color:#467ca2; border:solid 1px #316a91; border-bottom:0;}
		.list ul li a{padding-left: 10px;color: #fff; font-size:12px; display: block; font-weight:bold; height:36px;line-height: 36px;position: relative;}
		.list ul li ul li { border-left:0; border-right:0; background-color:#6196bb; border-color:#467ca2;}
		.list ul li ul li ul{display: none;}
		.list ul li ul li a{ padding-left:20px;}
		.list ul li ul li ul li { background-color:#d6e6f1; border-color:#6196bb; }
		.last{ background-color:#d6e6f1; border-color:#6196bb; }
		.list ul li ul li ul li a{ color:#316a91; padding-left:30px;}
		a:link,a:visited{color:#575757;text-decoration:none;}
		a:hover{color:#ef4165;text-decoration:none;}
		a:active{color:#1d7400;}
		/* clearfix */
		.clearfix:after{ visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0;}
		*html .clearfix{ zoom:1;}

		.preview{width:400px; height:465px;}
		/* imagesImg */
		.imagesImg{position:relative; height:52px; margin-top:1px; background-color:#F1F0F0; padding:6px 5px; width:390px; overflow:hidden;float:left;}
		.scrollbutton{width:14px; height:50px; overflow:hidden; position:relative; float:left; cursor:pointer; }
		.scrollbutton.imagesImgUp , .scrollbutton.imagesImgUp.disabled{background:url(files/images/d_08.png) no-repeat;}
		.scrollbutton.imagesImgDown , .scrollbutton.imagesImgDown.disabled{background:url(files/images/d_09.png) no-repeat; margin-left:375px; margin-top:-50px;}

		#imageMenu {height:50px; width:360px; overflow:hidden; margin-left:0; float:left;}
		#imageMenu li {height:50px; width:60px; overflow:hidden; float:left; text-align:center;}
		#imageMenu li img{width:50px; height:50px;cursor:pointer;}
		#imageMenu li#onlickImg img, #imageMenu li:hover img{ width:44px; height:44px; border:3px solid #959595;}
		/* bigImg */
		.bigImg{position:relative; float:left; width:400px; height:400px; overflow:hidden;}
		.bigImg #midimg{width:400px; height:400px;}
		.bigImg #winSelector{width:235px; height:210px;}
		#winSelector{position:absolute; cursor:crosshair; filter:alpha(opacity=15); -moz-opacity:0.15; opacity:0.15; background-color:#000; border:1px solid #fff;}
		/* bigView */
		#bigView{position:absolute;border: 1px solid #959595; overflow: hidden; z-index:999;}
		#bigView img{position:absolute;}
		.ui-btn-theme{background: #F23030;}
		.yuanprice{font-size: 14px;color: #666;text-decoration:line-through;margin-top: 5px;}
	</style>
</head>
<body>
<div class="r-wrap">
	<include file="./Application/Home/View/Public/head.html"/>
	<!--end header-->
	<div class="main-wrap">
		<div class="product product-view hasImg">
			<!--begin main-->
			<div class="main-t">

				<input type="hidden" name="goods_id" value="{$info.good_id}">
				<div class="fl w350" id="goodPreImgs" style="margin-left:10px;width:430px!important;margin-left: 120px;">
					<div class="preview">
						<div id="vertical" class="bigImg">
							<img src="__ROOT__{$info.picture}" width="400" height="400" id="midimg" />
							<div style="display:none;" id="winSelector"></div>
						</div><!--bigImg end-->
						<div class="imagesImg">
							<div class="scrollbutton imagesImgUp disabled"></div>
							<div id="imageMenu">
								<ul>
									<li><img src="__ROOT__{$info.picture}" width="68" height="68"/></li>
									<volist name="info['assist_picture']" id="v">
										<li><img src="__ROOT__{$v}" width="68" height="68"/></li>
									</volist>
								</ul>
							</div>
							<div class="scrollbutton imagesImgDown"></div>
						</div><!--imagesImg end-->
						<div id="bigView" style="display:none;"><img width="800" height="800"  alt="" src="" /></div>
					</div>
				</div>
				<div class="product-detail-wrap pr" style="margin-left:670px;">

					<div class="product-detail-title">
						<h1>{$info.good_name}</h1>
						<div class="product-detail-code lite-gray">
							<!--<span>商品编码：101</span>-->
						</div>
					</div>
					<div class="product-detail-item control-box">
						<div class="control-group pl25" style="line-height: 30px;">
							<if condition="session('user_vip') eq 0">
								<span class="fl">市场价格：</span>
								<div class="control-input" style="color: red;font-weight: bold;font-size: 20px;">￥{$info.price}</div>
								<else />
								<span class="fl">会员价格：</span>
								<span class="control-input" style="color: red;font-weight: bold;font-size: 20px;">￥{$info.vip_price}</span>
								&nbsp;&nbsp;<span class="yuanprice">￥{$info.price}</span>
							</if>
						</div>
					</div>
					<div class="product-detail-spec control-box ui-blue-choose pl20 mb20">
						<div style="width:100%;margin-top:10px;">
							<div style="width:60%;float:left;">
								<div class="lh30">
									<span class="mr20">规格：{$info['grade']}</span>
								</div>

								<div class="lh30">
									<span class="mr20">
										联系客服：<a target="_blank" style="vertical-align: text-top;" href="http://wpa.qq.com/msgrd?v=3&uin=2675162351&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:2675162351:52" alt="联系客服" title="联系客服"/></a>
										           <a target="_blank" style="vertical-align: text-top;" href="http://wpa.qq.com/msgrd?v=3&uin=2675162351&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:1478709334:52" alt="联系客服" title="联系客服"/></a>
									</span>
								</div>

								<div class="lh30">
									<span class="mr20">计量单位：件</span>
									<span class="mr20">起订量：1件</span>
								</div>

								<div class="lh30">
									<span class="mr20" style="color: red;"><b>免运费</b></span>
								</div>

								<div class="lh30">
									<span class="mr20">销量：{$info['sale']} 件</span>
								</div>

								<div class="product-tags lh30">包装尺寸：<span class="mr20">{$info['pack_length']} x {$info['pack_width']} x {$info['pack_height']}{$configInfo['pack_unit']}</span></div>

								<div class="control-group buyCountWrap">
									<span class="fl">购买数量：</span>
									<div class="control-input">
										<input type="number" min="1" class="ui-input w120 buyCount" id="num" name="goods_num" value="1" >
									</div>
								</div>
								<div class="product-tags lh30" style="margin-top: 10px;">上门安装：
									<b><if condition="($info['alone_install'] eq 0) and (session('user_vip') eq 1)"><span style="color: red;">{$info['vip_price']*$configInfo['install_price_rebate']}</span><elseif condition="($info['alone_install'] eq 0) and (session('user_vip') eq 0)"/><span style="color: red;">{$info['price']*$configInfo['install_price_rebate']}</span><else /><span style="color: red;font-weight: bold;">{$info['alone_install_price']}</span></if></b> 元/件，总安装费未满 <span style="color: red;font-weight: bold;">{$configInfo['min_install_price']}</span>元按<span style="color: red;font-weight: bold;"> {$configInfo['min_install_price']}</span>元收取
								</div>
								<div class="product-tags lh30" style="margin-top: 10px;">售后服务：
									<b>商品自安装之日起，一年内<span style="color: red;">免费</span>上门维修服务</b>
								</div>
								<div class="lh30">
									<p>安装费收取标准：</p>
									<p style="color: #999;">1）射灯、开关等类似小型部件，按 <eq name="info['alone_install']" value="1"><b style="color: red;">{$info['alone_install_price']}</b> 元/</eq>个收取</p>
									<p style="color: #999;">2）除小型部件的其余商品，按其总价的 <b style="color: red;">{$configInfo['install_price_rebate']*100}%</b> 收取</p>
									<p style="color: #999;">3）所有商品的安装费总额未满<b style="color: red;"> {$configInfo['min_install_price']} </b>元，按<b style="color: red;"> {$configInfo['min_install_price']} </b>元收取</p>
								</div>
							</div>
							<!--二维码图片，扫描直接跳转到对应的手机页面查看商品-->
							<div style="width:49%;float:left;">
							</div>
						</div>
					</div>
					<div class="control-box product-detail-op ml20">
						<div class="control-group mb5">
							<if condition="session('user_id') eq null">
								<a href="{:U('login')}"><input type="submit" onclick="alert('请先登录')" class="ui-btn ui-btn-lg ui-btn-theme mr10" value="加入购物车"></a>
								<else/>
								<input type="submit"  class="ui-btn ui-btn-lg ui-btn-theme mr10 Button1" value="加入购物车">
							</if>

						</div>
					</div>
				</div>
				<div class="productInto" style="margin-top:230px;">
					<ul class="ui-tab2-menu tabNav productintoNav">
						<li class="current"><a href="javascript:void(0)">商品信息</a></li>

					</ul>
					<div class="tabCon tabConitem product-desc">
						<div>
							<p>{$info.desc|htmlspecialchars_decode}</p>
						</div>
					</div>
				</div>


				<div class="cb"></div>
				<div class="control-box mt20"></div>
				<div id="albumWrap">
					<a type="button" class="close"></a>
					<div class="container">
						<div class="item">
							<img src="" data-bigsrc="http://oss.dinghuo123.com/images/productImage/img_try/p3651975d-08f1-4c2e-8bb3-03fe78570f3c.jpg" alt="">
						</div>

						<div class="item">
							<img src="" data-bigsrc="http://oss.dinghuo123.com/images/productImage/img_try/p9a82c754-f78e-4c15-966b-a2dd85fb0cf7.jpg" alt="">
						</div>

						<div class="item">
							<img src="" data-bigsrc="http://oss.dinghuo123.com/images/productImage/img_try/pa04ee548-7de4-4736-b1dd-8b7380d9c98b.jpg" alt="">
						</div>
					</div>
					<button class="pre"></button>
					<button class="next"></button>
				</div>
			</div>
		</div>
	</div>
</div>

<!--preview end-->
<script type="text/javascript">
	$(document).ready(function(){
		// 图片上下滚动
		var count = $("#imageMenu li").length - 5; /* 显示 6 个 li标签内容 */
		var interval = $("#imageMenu li:first").width();
		var curIndex = 0;

		$('.scrollbutton').click(function(){
			if( $(this).hasClass('disabled') ) return false;

			if ($(this).hasClass('imagesImgUp')) --curIndex;
			else ++curIndex;

			$('.scrollbutton').removeClass('disabled');
			if (curIndex == 0) $('.imagesImgUp').addClass('disabled');
			if (curIndex == count-1) $('.imagesImgDown').addClass('disabled');

			$("#imageMenu ul").stop(false, true).animate({"marginLeft" : -curIndex*interval + "px"}, 600);
		});
		// 解决 ie6 select框 问题
		$.fn.decorateIframe = function(options) {
			if ($.browser.msie && $.browser.version < 7) {
				var opts = $.extend({}, $.fn.decorateIframe.defaults, options);
				$(this).each(function() {
					var $myThis = $(this);
					//创建一个IFRAME
					var divIframe = $("<iframe />");
					divIframe.attr("id", opts.iframeId);
					divIframe.css("position", "absolute");
					divIframe.css("display", "none");
					divIframe.css("display", "block");
					divIframe.css("z-index", opts.iframeZIndex);
					divIframe.css("border");
					divIframe.css("top", "0");
					divIframe.css("left", "0");
					if (opts.width == 0) {
						divIframe.css("width", $myThis.width() + parseInt($myThis.css("padding")) * 2 + "px");
					}
					if (opts.height == 0) {
						divIframe.css("height", $myThis.height() + parseInt($myThis.css("padding")) * 2 + "px");
					}
					divIframe.css("filter", "mask(color=#fff)");
					$myThis.append(divIframe);
				});
			}
		}
		$.fn.decorateIframe.defaults = {
			iframeId: "decorateIframe1",
			iframeZIndex: -1,
			width: 0,
			height: 0
		}
		//放大镜视窗
		$("#bigView").decorateIframe();
		//点击到中图
		var midChangeHandler = null;

		$("#imageMenu li img").bind("click", function(){
			if ($(this).attr("id") != "onlickImg") {
				midChange($(this).attr("src").replace("images", "images"));
				$("#imageMenu li").removeAttr("id");
				$(this).parent().attr("id", "onlickImg");
			}
		}).bind("mouseover", function(){
			if ($(this).attr("id") != "onlickImg") {
				window.clearTimeout(midChangeHandler);
				midChange($(this).attr("src").replace("images", "images"));
				$(this).css({ "border": "3px solid #959595" });
			}
		}).bind("mouseout", function(){
			if($(this).attr("id") != "onlickImg"){
				$(this).removeAttr("style");
				midChangeHandler = window.setTimeout(function(){
					midChange($("#onlickImg img").attr("src").replace("images", "images"));
				}, 1000);
			}
		});
		function midChange(src) {
			$("#midimg").attr("src", src).load(function() {
				changeViewImg();
			});
		}
		//大视窗看图
		function mouseover(e) {
			if ($("#winSelector").css("display") == "none") {
				$("#winSelector,#bigView").show();
			}
			$("#winSelector").css(fixedPosition(e));
			e.stopPropagation();
		}
		function mouseOut(e) {
			if ($("#winSelector").css("display") != "none") {
				$("#winSelector,#bigView").hide();
			}
			e.stopPropagation();
		}
		$("#midimg").mouseover(mouseover); //中图事件
		$("#midimg,#winSelector").mousemove(mouseover).mouseout(mouseOut); //选择器事件

		var $divWidth = $("#winSelector").width(); //选择器宽度
		var $divHeight = $("#winSelector").height(); //选择器高度
		var $imgWidth = $("#midimg").width(); //中图宽度
		var $imgHeight = $("#midimg").height(); //中图高度
		var $viewImgWidth = $viewImgHeight = $height = null; //IE加载后才能得到 大图宽度 大图高度 大图视窗高度

		function changeViewImg() {
			$("#bigView img").attr("src", $("#midimg").attr("src").replace("images", "images"));
		}
		changeViewImg();
		$("#bigView").scrollLeft(0).scrollTop(0);
		function fixedPosition(e) {
			if (e == null) {
				return;
			}
			var $imgLeft = $("#midimg").offset().left; //中图左边距
			var $imgTop = $("#midimg").offset().top; //中图上边距
			X = e.pageX - $imgLeft - $divWidth / 2; //selector顶点坐标 X
			Y = e.pageY - $imgTop - $divHeight / 2; //selector顶点坐标 Y
			X = X < 0 ? 0 : X;
			Y = Y < 0 ? 0 : Y;
			X = X + $divWidth > $imgWidth ? $imgWidth - $divWidth : X;
			Y = Y + $divHeight > $imgHeight ? $imgHeight - $divHeight : Y;

			if ($viewImgWidth == null) {
				$viewImgWidth = $("#bigView img").outerWidth();
				$viewImgHeight = $("#bigView img").height();
				if ($viewImgWidth < 200 || $viewImgHeight < 200) {
					$viewImgWidth = $viewImgHeight = 800;
				}
				$height = $divHeight * $viewImgHeight / $imgHeight;
				$("#bigView").width($divWidth * $viewImgWidth / $imgWidth);
				$("#bigView").height($height);
			}
			var scrollX = X * $viewImgWidth / $imgWidth;
			var scrollY = Y * $viewImgHeight / $imgHeight;
			$("#bigView img").css({ "left": scrollX * -1, "top": scrollY * -1 });
			$("#bigView").css({ "top": 75, "left": $(".preview").offset().left + $(".preview").width() + 15 });

			return { left: X, top: Y };
		}
	});
</script>
<script type="text/javascript">
	$(".Button1").click(function() {
		var shopOffset = $("#shoping").offset();
		var cloneDiv = $("#midimg").clone();
		var proOffset = $("#midimg").offset();
		var goods_id = $("input[type=hidden]").val();
		var num = $('#num').val();
		if(num<1){
			alert('请输入正确数量');
			return false;
		}
		cloneDiv.css({ "position": "fixed", "top": proOffset.top, "left": proOffset.left ,"z-index":"1999","width":"15%"});
		cloneDiv.removeAttr("id")
		$("#midimg").parent().append(cloneDiv);

		cloneDiv.animate({
			left: shopOffset.left,
			top: shopOffset.top,
			width:"0px",
			height:"0px"
		},"slow",function(){
			//添加购物车
			$.ajax({
				url:"{:U('add_cart')}",
				data:{"goods_id":goods_id,'num':num},
				type:"post",
				success:function (e){
					if(e == 1){
						$("#shop").text(parseInt($("#shop").text())+1)
					}else if(e == -1){
						alert('已添加过该商品');
					}else{
						alert("数据异常");
					}
				}
			})

		});
	});

</script>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		$('.inactive').click(function(){
			if($(this).siblings('ul').css('display')=='none'){
				$(this).parent('li').siblings('li').removeClass('inactives');
				$(this).addClass('inactives');
				$(this).siblings('ul').slideDown(100).children('li');
				if($(this).parents('li').siblings('li').children('ul').css('display')=='block'){
					$(this).parents('li').siblings('li').children('ul').parent('li').children('a').removeClass('inactives');
					$(this).parents('li').siblings('li').children('ul').slideUp(100);

				}
			}else{
				//控制自身变成+号
				$(this).removeClass('inactives');
				//控制自身菜单下子菜单隐藏
				$(this).siblings('ul').slideUp(100);
				//控制自身子菜单变成+号
				$(this).siblings('ul').children('li').children('ul').parent('li').children('a').addClass('inactives');
				//控制自身菜单下子菜单隐藏
				$(this).siblings('ul').children('li').children('ul').slideUp(100);

				//控制同级菜单只保持一个是展开的（-号显示）
				$(this).siblings('ul').children('li').children('a').removeClass('inactives');
			}
		})
	});
</script>
<script>
	$('.side-nav').find('.side-ul').hide();
	$('.side-nav').hover(function(){
		$(this).find('.side-ul').show();
	},function(){
		$(this).find('.side-ul').hide();
	})
	$('.side-ul> li').hover(function(){
		$(this).css('background','#fff').find('a:first-child').css('color','#000');
		$(this).find('.nav-items').show();
	},function(){
		$(this).css('background','#4f4f4f').find('a:first-child').css('color','#fff');
		$(this).find('.nav-items').hide();
	})
</script>
</html>